package com.koron.rating.aop;

import com.koron.bean.base.Response;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class IdempotentExceptionAdvice {

    @ExceptionHandler(value = IdempotentException.class)
    public Response handlerIdempotentException(IdempotentException e){
        log.info(e.getMessage());
        return Response.fail(e.getMessage());
    }
}
